#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QInputDialog>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int num = QInputDialog::getInt(this,"输入整数框","请输入整数");
    qDebug()<<num;
}

void MainWindow::on_pushButton_2_clicked()
{
    int doublenum = QInputDialog::getDouble(this,"输入浮点数框","请输入浮点数");
    qDebug()<<doublenum;
}

void MainWindow::on_pushButton_3_clicked()
{
    QStringList item;
    item.push_back("1");
    item.push_back("2");
    item.push_back("3");
    item.push_back("4");
    QString str = QInputDialog::getItem(this,"输入浮点数框","请输入浮点数",item);

    qDebug()<<str;
}
